home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 6.1 KB | 161 lines | [TEXT/MPS ] |
- (*
- File: TranslationExtensions.mod
-
- Contains: Macintosh Easy Open Translation Extension Interfaces.
-
- Version: Technology: Macintosh Easy Open 1.1
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE TranslationExtensions;
-
- IMPORT SYSTEM, Types, Memory, Quickdraw, Files, Components;
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)
-
- CONST
- kSupportsFileTranslation* = 1;
- kSupportsScrapTranslation* = 2;
- kTranslatorCanGenerateFilename* = 4;
-
-
- TYPE
- FileType* = Types.OSType;
-
- ScrapType* = Types.ResType;
-
- TranslationAttributes* = LONGINT;
-
-
- CONST
- taDstDocNeedsResourceFork* = 1;
- taDstIsAppTranslation* = 2;
-
-
- TYPE
- FileTypeSpec* = RECORD
- format*: FileType;
- hint*: LONGINT;
- flags*: TranslationAttributes; (* taDstDocNeedsResourceFork, taDstIsAppTranslation*)
- catInfoType*: Types.OSType;
- catInfoCreator*: Types.OSType;
- END;
-
- FileTranslationList* = RECORD
- modDate*: LONGINT;
- groupCount*: LONGINT;
- (* unsigned long group1SrcCount;*)
- (* unsigned long group1SrcEntrySize* = sizeof(FileTypeSpec);*)
- (* FileTypeSpec group1SrcTypes[group1SrcCount]*)
- (* unsigned long group1DstCount;*)
- (* unsigned long group1DstEntrySize* = sizeof(FileTypeSpec);*)
- (* FileTypeSpec group1DstTypes[group1DstCount]*)
- END;
-
- FileTranslationListPtr* = POINTER TO FileTranslationList;
- FileTranslationListHandle* = HANDLE TO FileTranslationList (*ΔΔ POINTER TO FileTranslationListPtr*);
-
- ScrapTypeSpec* = RECORD
- format*: ScrapType;
- hint*: LONGINT;
- END;
-
- ScrapTranslationList* = RECORD
- modDate*: LONGINT;
- groupCount*: LONGINT;
- (* unsigned long group1SrcCount;*)
- (* unsigned long group1SrcEntrySize* = sizeof(ScrapTypeSpec);*)
- (* ScrapTypeSpec group1SrcTypes[group1SrcCount]*)
- (* unsigned long group1DstCount;*)
- (* unsigned long group1DstEntrySize* = sizeof(ScrapTypeSpec);*)
- (* ScrapTypeSpec group1DstTypes[group1DstCount]*)
- END;
-
- ScrapTranslationListPtr* = POINTER TO ScrapTranslationList;
- ScrapTranslationListHandle* = HANDLE TO ScrapTranslationList (*ΔΔ POINTER TO ScrapTranslationListPtr*);
-
- (* definition of callbacks to update progress dialog*)
- TranslationRefNum* = LONGINT;
-
- (*****************************************************************************************
- *
- * This routine sets the advertisement in the top half of the progress dialog.
- * It is called once at the beginning of your DoTranslateFile routine.
- *
- * Enter: refNum Translation reference supplied to DoTranslateFile.
- * advertisement A handle to the picture to display. This must be non-purgable.
- * Before returning from DoTranslateFile, you should dispose
- * of the memory. (Normally, it is in the temp translation heap
- * so it is cleaned up for you.)
- *
- * Exit: returns noErr, paramErr, or memFullErr
- *)
-
- PROCEDURE SetTranslationAdvertisement*(refNum: TranslationRefNum; advertisement: Quickdraw.PicHandle): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $7002, $ABFC;
- (*$END*)
- (*****************************************************************************************
- *
- * This routine updates the progress bar in the progress dialog.
- * It is called repeatedly from within your DoTranslateFile routine.
- * It should be called often, so that the user will get feedback if he tries to cancel.
- *
- * Enter: refNum translation reference supplied to DoTranslateFile.
- * progress percent complete (0-100)
- *
- * Exit: canceled TRUE if the user clicked the Cancel button, FALSE otherwise
- * returns noErr, paramErr, or memFullErr
- *)
- PROCEDURE UpdateTranslationProgress*(refNum: TranslationRefNum; percentDone: INTEGER; VAR canceled: BOOLEAN): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $7001, $ABFC;
- (*$END*)
- (* ComponentMgr selectors for routines*)
-
- CONST
- kTranslateGetFileTranslationList* = 0; (* component selectors*)
- kTranslateIdentifyFile* = 1;
- kTranslateTranslateFile* = 2;
- kTranslateGetTranslatedFilename* = 3;
- kTranslateGetScrapTranslationList* = 10; (* skip to scrap routines*)
- kTranslateIdentifyScrap* = 11;
- kTranslateTranslateScrap* = 12;
-
- (* Routines to implment in a file translation extension*)
- TYPE
- DoGetFileTranslationListProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; translationList: FileTranslationListHandle): Components.ComponentResult;
-
- DoIdentifyFileProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; (*CONST*)VAR theDocument: Files.FSSpec; VAR docType: FileType): Components.ComponentResult;
-
- DoTranslateFileProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; refNum: TranslationRefNum; (*CONST*)VAR sourceDocument: Files.FSSpec; srcType: FileType; srcTypeHint: LONGINT; (*CONST*)VAR dstDoc: Files.FSSpec; dstType: FileType; dstTypeHint: LONGINT): Components.ComponentResult;
-
- DoGetTranslatedFilenameProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; dstType: FileType; dstTypeHint: LONGINT; VAR theDocument: Files.FSSpec): Components.ComponentResult;
-
- (* Routine to implement in a scrap translation extension*)
- DoGetScrapTranslationListProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; list: ScrapTranslationListHandle): Components.ComponentResult;
-
- DoIdentifyScrapProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; dataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; dataLength: Memory.Size; VAR dataFormat: ScrapType): Components.ComponentResult;
-
- DoTranslateScrapProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (self: Components.ComponentInstance; refNum: TranslationRefNum; srcDataPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; srcDataLength: Memory.Size; srcType: ScrapType; srcTypeHint: LONGINT; dstData: Types.Handle; dstType: ScrapType; dstTypeHint: LONGINT): Components.ComponentResult;
-
-
- (* $ALIGN RESET*)
- (* $POP*)
-
- END TranslationExtensions.
-